﻿@model DLM.Domain.Model.Account
@using Webdiyer.WebControls.Mvc;
@using DLM.Web.MVC.Helper;
<script type="text/javascript">
    $(document).ready(function () {
        $(".password").focus(function () {
            $("#divCaptcha").show(500);
            //$("#divCaptcha").css("display", "block")
        });

    });
</script>
<div id="top_bar">
    <div id="top_bar_content">
        <h1 id="logo" class="pngfix">
            <a>都来米都市活动交友社区</a></h1>
        <div class="login_bar">
        </div>
        @if (Request.IsAuthenticated)
        {
            <div class="sevice_bar">
                <div class="sevice_bar_top">
                    服务中心</div>
                <ul class="sevice_bar_ul">
                    <li><a href="@Url.Action("UserCenter", "User")">账户设置</a></li>
                    <li><a href="@Url.Action("MessageCenter", "User")">消息中心</a></li>
                     <li><a href="@Url.Action("Orders", "Trade")">我的订单</a></li>
                     <li><a href="@Url.Action("Buy", "Trade")">积分充值</a></li>
                </ul>
            </div>
        }
        @if (!Request.IsAuthenticated)
        {
            using (Html.BeginForm("Login", "Account", FormMethod.Post))
            {
            <div class="login_bar">
                <label class="lb">
                    请登录&nbsp;
                    @Html.TextBoxFor(m => m.AccountName, new { @class = "text", tabindex = "1" })
                </label>
                <label class="lb">
                    密码&nbsp;
                    @Html.PasswordFor(m => m.Password, new { @class = "password", tabindex = "2" })
                </label>
                @*                <label class="lb">
                    <input type="checkbox" class="checkbox" />
                    记住</label>*@
                <input type="submit" value="登录" class="btn_s login" />
                @Html.ActionLinkButton("注册", "Register", "Account", null, "btn_s register", "btnRegister")
                <div id="divCaptcha" style="display: none;" class="val_box">
                    <div class="val_box_inner" id="capthca">
                        @Html.MvcCaptcha(new MvcCaptchaOptions { Width = 100, Height = 39, CaptchaImageContainerId = "captchaImage", TextLength = 4, DelayLoad = true, ValidationInputBoxId = "_mvcCaptchaText" })
                        <span id="captchaImage" style="width: 59px; height: 39px;"></span>
                    </div>
                    <label class="lb">
                        验证码&nbsp;
                        <input type="text" name="_mvcCaptchaText" id="_mvcCaptchaText" class="text" tabindex="3" />
                    </label>
                </div>
            </div>
            }

        }
        @if(Request.IsAuthenticated)
        {
            using (Html.BeginForm("LogOff", "Account", FormMethod.Post))
            {
   
            <div class="user_bar">
                @if (Request.Url.LocalPath == "/")
                {
                     <a href="@Url.Action("Default", "Home")" class="check_out">回到我的活动中心</a> 
                }
                else
                {
                     <a href="@Url.Action("Index", "Home")" class="check_out">点击查看最新活动</a>
                    
                }
                &nbsp;&nbsp;您好！<a
                    href="@Url.Action("Default", "Home")">@User.Identity.Name</a>&nbsp;欢迎登陆&nbsp;&nbsp; @Html.ActionLink("退出", "LogOff", "Account")</div>
            }

        }
    </div>
</div>
